package net.qhzw.geologr5.gis.service.system.controller;

import net.qhzw.geologr5.gis.common.framework.utils.JsonResult;
import net.qhzw.geologr5.gis.service.system.entity.Legend;
import net.qhzw.geologr5.gis.service.system.query.LegendQuery;
import net.qhzw.geologr5.gis.service.system.service.LegendService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;


/***
 * 图例前端控制器
 */

@RestController
@RequestMapping("legend")
public class LegendController {


    @Autowired
    private LegendService legendService;


    /***
     * 图例查询
     * @param legendQuery
     * @return
     */
    @GetMapping("select")
    public JsonResult select(LegendQuery legendQuery) {
        return legendService.select(legendQuery);
    }

    /***
     * 图例新增编辑
     * @param legend
     * @return
     */
    @PostMapping("edit")
    public JsonResult edit(@RequestBody Legend legend) {
        return legendService.edit(legend);
    }


    /***
     * 图例删除
     * @param ids
     * @return
     */
    @DeleteMapping("delete/{ids}")
    public JsonResult delete(@PathVariable("ids") Integer[] ids) {
        return legendService.delete(ids);
    }
}
